/* ========================================
 *
 * Copyright YOUR COMPANY, THE YEAR
 * All Rights Reserved
 * UNPUBLISHED, LICENSED SOFTWARE.
 *
 * CONFIDENTIAL AND PROPRIETARY INFORMATION
 * WHICH IS THE PROPERTY OF your company.
 *
 * ========================================
*/
#ifndef MAIN_H
#define MAIN_H
    
#include <project.h> 
/* Definition for operating mode */
#define CAPSENSE_TUNER
//#define  DEBUG_BRIDGE_CAPSENSE
//#define WORK_CAPSENSE
//#define WORK_CAPSENSE1
//#define SW_Tx_UART
#define ADC_CONVENT    
 #define WDT_FUN   
//   #define UART_FUN

    
#ifdef  DEBUG_BRIDGE_CAPSENSE
uint16 Debugbuffer[64]={0};
uint16 data_change(uint16 dat);
#endif
#ifdef WORK_CAPSENSE
uint8 slbuffer[6]={0};
#endif    
#ifdef ADC_CONVENT
uint8 adc_cnt=0;   
uint8 mVolts1,mVolts2,mVolts3,mVolts4;
#endif
typedef enum
{
    STATE_CAPSENSE = 0x00u,
    STATE_ADC      = 0x01u
}SCAN_MODE;

/* Variable to store the next state */
SCAN_MODE scanState = STATE_CAPSENSE;

#ifdef WDT_FUN
/* Define desired interrupt delay in milliseconds to calculate ilo match count */
#define WAKEUP_PERIOD_IN_MS        100
/* Calculate ILO match count to get wdt periodic updates */
#define ILO_MATCH_COUNTS        ((WAKEUP_PERIOD_IN_MS * CY_SYS_CLK_ILO_DESIRED_FREQ_HZ)/ 1000)

uint32  iloMatchCounts = ILO_MATCH_COUNTS;
    void WDT_Start(void);
/*Feeds the watchdog. Clear the watchdog interrupt */
#define FEED_WDT() CySysWdtClearInterrupt()
#endif
void Capsense_pross(void );

CY_ISR(Timer_isr);
#endif
/* [] END OF FILE */
